package com.rcloud.server.sealtalk.service;

import com.rcloud.server.sealtalk.dao.UserCollectMapper;
import com.rcloud.server.sealtalk.domain.UserCollect;
import com.rcloud.server.sealtalk.model.dto.UserCollectDTO;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xiaochaoge
 * @title: UserCollectService
 * @projectName sealtalk-server
 * @description: 用户收藏表业务层
 * @date 2021/6/11 15:45
 */
@Service
public class UserCollectService extends AbstractBaseService<UserCollect, Integer> {
    @Resource
    private UserCollectMapper mapper;

    @Override
    protected Mapper<UserCollect> getMapper() {
        return mapper;
    }

    /**
     * 获取收藏列表
     */
    public List<UserCollectDTO> queryCollectList(Integer type, Integer userId) {
       return mapper.queryCollectList(type,userId);
    }
    /**
     * 获取用户的收藏列表
     */
    public List<UserCollectDTO> queryCommonWordsList(Integer userId) {
       return mapper.queryCommonWordsList(userId);
    }


}
